package org.springframework.util;

import java.lang.reflect.Array;
import java.util.Arrays;

public abstract class ObjectUtils
{
  private static final String ARRAY_ELEMENT_SEPARATOR = ", ";
  private static final String ARRAY_END = "}";
  private static final String ARRAY_START = "{";
  private static final String EMPTY_ARRAY = "{}";
  private static final String EMPTY_STRING = "";
  private static final int INITIAL_HASH = 7;
  private static final int MULTIPLIER = 31;
  private static final String NULL_STRING = "null";

  public static Object[] addObjectToArray(Object[] paramArrayOfObject, Object paramObject)
  {
    Object localObject = Object.class;
    if (paramArrayOfObject != null)
    {
      localObject = paramArrayOfObject.getClass().getComponentType();
      if (paramArrayOfObject == null)
        break label72;
    }
    label72: for (int i = 1 + paramArrayOfObject.length; ; i = 1)
    {
      Object[] arrayOfObject = (Object[])Array.newInstance((Class)localObject, i);
      if (paramArrayOfObject != null)
        System.arraycopy(paramArrayOfObject, 0, arrayOfObject, 0, paramArrayOfObject.length);
      arrayOfObject[(-1 + arrayOfObject.length)] = paramObject;
      return arrayOfObject;
      if (paramObject == null)
        break;
      localObject = paramObject.getClass();
      break;
    }
  }

  public static boolean containsElement(Object[] paramArrayOfObject, Object paramObject)
  {
    if (paramArrayOfObject == null);
    while (true)
    {
      return false;
      int i = paramArrayOfObject.length;
      for (int j = 0; j < i; j++)
        if (nullSafeEquals(paramArrayOfObject[j], paramObject))
          return true;
    }
  }

  public static String getDisplayString(Object paramObject)
  {
    if (paramObject == null)
      return "";
    return nullSafeToString(paramObject);
  }

  public static String getIdentityHexString(Object paramObject)
  {
    return Integer.toHexString(System.identityHashCode(paramObject));
  }

  public static int hashCode(double paramDouble)
  {
    return hashCode(Double.doubleToLongBits(paramDouble));
  }

  public static int hashCode(float paramFloat)
  {
    return Float.floatToIntBits(paramFloat);
  }

  public static int hashCode(long paramLong)
  {
    return (int)(paramLong ^ paramLong >>> 32);
  }

  public static int hashCode(boolean paramBoolean)
  {
    if (paramBoolean)
      return 1231;
    return 1237;
  }

  public static String identityToString(Object paramObject)
  {
    if (paramObject == null)
      return "";
    return paramObject.getClass().getName() + "@" + getIdentityHexString(paramObject);
  }

  public static boolean isArray(Object paramObject)
  {
    return (paramObject != null) && (paramObject.getClass().isArray());
  }

  public static boolean isCheckedException(Throwable paramThrowable)
  {
    return (!(paramThrowable instanceof RuntimeException)) && (!(paramThrowable instanceof Error));
  }

  public static boolean isCompatibleWithThrowsClause(Throwable paramThrowable, Class[] paramArrayOfClass)
  {
    if (!isCheckedException(paramThrowable))
      return true;
    if (paramArrayOfClass != null);
    for (int i = 0; ; i++)
    {
      if (i >= paramArrayOfClass.length)
        return false;
      if (paramArrayOfClass[i].isAssignableFrom(paramThrowable.getClass()))
        break;
    }
  }

  public static boolean isEmpty(Object[] paramArrayOfObject)
  {
    return (paramArrayOfObject == null) || (paramArrayOfObject.length == 0);
  }

  public static String nullSafeClassName(Object paramObject)
  {
    if (paramObject != null)
      return paramObject.getClass().getName();
    return "null";
  }

  public static boolean nullSafeEquals(Object paramObject1, Object paramObject2)
  {
    if (paramObject1 == paramObject2);
    do
    {
      return true;
      if ((paramObject1 == null) || (paramObject2 == null))
        return false;
    }
    while (paramObject1.equals(paramObject2));
    if ((paramObject1.getClass().isArray()) && (paramObject2.getClass().isArray()))
    {
      if (((paramObject1 instanceof Object[])) && ((paramObject2 instanceof Object[])))
        return Arrays.equals((Object[])paramObject1, (Object[])paramObject2);
      if (((paramObject1 instanceof boolean[])) && ((paramObject2 instanceof boolean[])))
        return Arrays.equals((boolean[])paramObject1, (boolean[])paramObject2);
      if (((paramObject1 instanceof byte[])) && ((paramObject2 instanceof byte[])))
        return Arrays.equals((byte[])paramObject1, (byte[])paramObject2);
      if (((paramObject1 instanceof char[])) && ((paramObject2 instanceof char[])))
        return Arrays.equals((char[])paramObject1, (char[])paramObject2);
      if (((paramObject1 instanceof double[])) && ((paramObject2 instanceof double[])))
        return Arrays.equals((double[])paramObject1, (double[])paramObject2);
      if (((paramObject1 instanceof float[])) && ((paramObject2 instanceof float[])))
        return Arrays.equals((float[])paramObject1, (float[])paramObject2);
      if (((paramObject1 instanceof int[])) && ((paramObject2 instanceof int[])))
        return Arrays.equals((int[])paramObject1, (int[])paramObject2);
      if (((paramObject1 instanceof long[])) && ((paramObject2 instanceof long[])))
        return Arrays.equals((long[])paramObject1, (long[])paramObject2);
      if (((paramObject1 instanceof short[])) && ((paramObject2 instanceof short[])))
        return Arrays.equals((short[])paramObject1, (short[])paramObject2);
    }
    return false;
  }

  public static int nullSafeHashCode(Object paramObject)
  {
    if (paramObject == null)
      return 0;
    if (paramObject.getClass().isArray())
    {
      if ((paramObject instanceof Object[]))
        return nullSafeHashCode((Object[])paramObject);
      if ((paramObject instanceof boolean[]))
        return nullSafeHashCode((boolean[])paramObject);
      if ((paramObject instanceof byte[]))
        return nullSafeHashCode((byte[])paramObject);
      if ((paramObject instanceof char[]))
        return nullSafeHashCode((char[])paramObject);
      if ((paramObject instanceof double[]))
        return nullSafeHashCode((double[])paramObject);
      if ((paramObject instanceof float[]))
        return nullSafeHashCode((float[])paramObject);
      if ((paramObject instanceof int[]))
        return nullSafeHashCode((int[])paramObject);
      if ((paramObject instanceof long[]))
        return nullSafeHashCode((long[])paramObject);
      if ((paramObject instanceof short[]))
        return nullSafeHashCode((short[])paramObject);
    }
    return paramObject.hashCode();
  }

  public static int nullSafeHashCode(byte[] paramArrayOfByte)
  {
    int i;
    if (paramArrayOfByte == null)
      i = 0;
    while (true)
    {
      return i;
      i = 7;
      int j = paramArrayOfByte.length;
      for (int k = 0; k < j; k++)
        i = i * 31 + paramArrayOfByte[k];
    }
  }

  public static int nullSafeHashCode(char[] paramArrayOfChar)
  {
    int i;
    if (paramArrayOfChar == null)
      i = 0;
    while (true)
    {
      return i;
      i = 7;
      int j = paramArrayOfChar.length;
      for (int k = 0; k < j; k++)
        i = i * 31 + paramArrayOfChar[k];
    }
  }

  public static int nullSafeHashCode(double[] paramArrayOfDouble)
  {
    int i;
    if (paramArrayOfDouble == null)
      i = 0;
    while (true)
    {
      return i;
      i = 7;
      int j = paramArrayOfDouble.length;
      for (int k = 0; k < j; k++)
        i = i * 31 + hashCode(paramArrayOfDouble[k]);
    }
  }

  public static int nullSafeHashCode(float[] paramArrayOfFloat)
  {
    int i;
    if (paramArrayOfFloat == null)
      i = 0;
    while (true)
    {
      return i;
      i = 7;
      int j = paramArrayOfFloat.length;
      for (int k = 0; k < j; k++)
        i = i * 31 + hashCode(paramArrayOfFloat[k]);
    }
  }

  public static int nullSafeHashCode(int[] paramArrayOfInt)
  {
    int i;
    if (paramArrayOfInt == null)
      i = 0;
    while (true)
    {
      return i;
      i = 7;
      int j = paramArrayOfInt.length;
      for (int k = 0; k < j; k++)
        i = i * 31 + paramArrayOfInt[k];
    }
  }

  public static int nullSafeHashCode(long[] paramArrayOfLong)
  {
    int i;
    if (paramArrayOfLong == null)
      i = 0;
    while (true)
    {
      return i;
      i = 7;
      int j = paramArrayOfLong.length;
      for (int k = 0; k < j; k++)
        i = i * 31 + hashCode(paramArrayOfLong[k]);
    }
  }

  public static int nullSafeHashCode(Object[] paramArrayOfObject)
  {
    int i;
    if (paramArrayOfObject == null)
      i = 0;
    while (true)
    {
      return i;
      i = 7;
      int j = paramArrayOfObject.length;
      for (int k = 0; k < j; k++)
        i = i * 31 + nullSafeHashCode(paramArrayOfObject[k]);
    }
  }

  public static int nullSafeHashCode(short[] paramArrayOfShort)
  {
    int i;
    if (paramArrayOfShort == null)
      i = 0;
    while (true)
    {
      return i;
      i = 7;
      int j = paramArrayOfShort.length;
      for (int k = 0; k < j; k++)
        i = i * 31 + paramArrayOfShort[k];
    }
  }

  public static int nullSafeHashCode(boolean[] paramArrayOfBoolean)
  {
    int i;
    if (paramArrayOfBoolean == null)
      i = 0;
    while (true)
    {
      return i;
      i = 7;
      int j = paramArrayOfBoolean.length;
      for (int k = 0; k < j; k++)
        i = i * 31 + hashCode(paramArrayOfBoolean[k]);
    }
  }

  public static String nullSafeToString(Object paramObject)
  {
    if (paramObject == null)
      return "null";
    if ((paramObject instanceof String))
      return (String)paramObject;
    if ((paramObject instanceof Object[]))
      return nullSafeToString((Object[])paramObject);
    if ((paramObject instanceof boolean[]))
      return nullSafeToString((boolean[])paramObject);
    if ((paramObject instanceof byte[]))
      return nullSafeToString((byte[])paramObject);
    if ((paramObject instanceof char[]))
      return nullSafeToString((char[])paramObject);
    if ((paramObject instanceof double[]))
      return nullSafeToString((double[])paramObject);
    if ((paramObject instanceof float[]))
      return nullSafeToString((float[])paramObject);
    if ((paramObject instanceof int[]))
      return nullSafeToString((int[])paramObject);
    if ((paramObject instanceof long[]))
      return nullSafeToString((long[])paramObject);
    if ((paramObject instanceof short[]))
      return nullSafeToString((short[])paramObject);
    String str = paramObject.toString();
    if (str != null);
    while (true)
    {
      return str;
      str = "";
    }
  }

  public static String nullSafeToString(byte[] paramArrayOfByte)
  {
    if (paramArrayOfByte == null)
      return "null";
    int i = paramArrayOfByte.length;
    if (i == 0)
      return "{}";
    StringBuilder localStringBuilder = new StringBuilder();
    int j = 0;
    if (j >= i)
    {
      localStringBuilder.append("}");
      return localStringBuilder.toString();
    }
    if (j == 0)
      localStringBuilder.append("{");
    while (true)
    {
      localStringBuilder.append(paramArrayOfByte[j]);
      j++;
      break;
      localStringBuilder.append(", ");
    }
  }

  public static String nullSafeToString(char[] paramArrayOfChar)
  {
    if (paramArrayOfChar == null)
      return "null";
    int i = paramArrayOfChar.length;
    if (i == 0)
      return "{}";
    StringBuilder localStringBuilder = new StringBuilder();
    int j = 0;
    if (j >= i)
    {
      localStringBuilder.append("}");
      return localStringBuilder.toString();
    }
    if (j == 0)
      localStringBuilder.append("{");
    while (true)
    {
      localStringBuilder.append("'").append(paramArrayOfChar[j]).append("'");
      j++;
      break;
      localStringBuilder.append(", ");
    }
  }

  public static String nullSafeToString(double[] paramArrayOfDouble)
  {
    if (paramArrayOfDouble == null)
      return "null";
    int i = paramArrayOfDouble.length;
    if (i == 0)
      return "{}";
    StringBuilder localStringBuilder = new StringBuilder();
    int j = 0;
    if (j >= i)
    {
      localStringBuilder.append("}");
      return localStringBuilder.toString();
    }
    if (j == 0)
      localStringBuilder.append("{");
    while (true)
    {
      localStringBuilder.append(paramArrayOfDouble[j]);
      j++;
      break;
      localStringBuilder.append(", ");
    }
  }

  public static String nullSafeToString(float[] paramArrayOfFloat)
  {
    if (paramArrayOfFloat == null)
      return "null";
    int i = paramArrayOfFloat.length;
    if (i == 0)
      return "{}";
    StringBuilder localStringBuilder = new StringBuilder();
    int j = 0;
    if (j >= i)
    {
      localStringBuilder.append("}");
      return localStringBuilder.toString();
    }
    if (j == 0)
      localStringBuilder.append("{");
    while (true)
    {
      localStringBuilder.append(paramArrayOfFloat[j]);
      j++;
      break;
      localStringBuilder.append(", ");
    }
  }

  public static String nullSafeToString(int[] paramArrayOfInt)
  {
    if (paramArrayOfInt == null)
      return "null";
    int i = paramArrayOfInt.length;
    if (i == 0)
      return "{}";
    StringBuilder localStringBuilder = new StringBuilder();
    int j = 0;
    if (j >= i)
    {
      localStringBuilder.append("}");
      return localStringBuilder.toString();
    }
    if (j == 0)
      localStringBuilder.append("{");
    while (true)
    {
      localStringBuilder.append(paramArrayOfInt[j]);
      j++;
      break;
      localStringBuilder.append(", ");
    }
  }

  public static String nullSafeToString(long[] paramArrayOfLong)
  {
    if (paramArrayOfLong == null)
      return "null";
    int i = paramArrayOfLong.length;
    if (i == 0)
      return "{}";
    StringBuilder localStringBuilder = new StringBuilder();
    int j = 0;
    if (j >= i)
    {
      localStringBuilder.append("}");
      return localStringBuilder.toString();
    }
    if (j == 0)
      localStringBuilder.append("{");
    while (true)
    {
      localStringBuilder.append(paramArrayOfLong[j]);
      j++;
      break;
      localStringBuilder.append(", ");
    }
  }

  public static String nullSafeToString(Object[] paramArrayOfObject)
  {
    if (paramArrayOfObject == null)
      return "null";
    int i = paramArrayOfObject.length;
    if (i == 0)
      return "{}";
    StringBuilder localStringBuilder = new StringBuilder();
    int j = 0;
    if (j >= i)
    {
      localStringBuilder.append("}");
      return localStringBuilder.toString();
    }
    if (j == 0)
      localStringBuilder.append("{");
    while (true)
    {
      localStringBuilder.append(String.valueOf(paramArrayOfObject[j]));
      j++;
      break;
      localStringBuilder.append(", ");
    }
  }

  public static String nullSafeToString(short[] paramArrayOfShort)
  {
    if (paramArrayOfShort == null)
      return "null";
    int i = paramArrayOfShort.length;
    if (i == 0)
      return "{}";
    StringBuilder localStringBuilder = new StringBuilder();
    int j = 0;
    if (j >= i)
    {
      localStringBuilder.append("}");
      return localStringBuilder.toString();
    }
    if (j == 0)
      localStringBuilder.append("{");
    while (true)
    {
      localStringBuilder.append(paramArrayOfShort[j]);
      j++;
      break;
      localStringBuilder.append(", ");
    }
  }

  public static String nullSafeToString(boolean[] paramArrayOfBoolean)
  {
    if (paramArrayOfBoolean == null)
      return "null";
    int i = paramArrayOfBoolean.length;
    if (i == 0)
      return "{}";
    StringBuilder localStringBuilder = new StringBuilder();
    int j = 0;
    if (j >= i)
    {
      localStringBuilder.append("}");
      return localStringBuilder.toString();
    }
    if (j == 0)
      localStringBuilder.append("{");
    while (true)
    {
      localStringBuilder.append(paramArrayOfBoolean[j]);
      j++;
      break;
      localStringBuilder.append(", ");
    }
  }

  public static Object[] toObjectArray(Object paramObject)
  {
    if ((paramObject instanceof Object[]))
      return (Object[])paramObject;
    if (paramObject == null)
      return new Object[0];
    if (!paramObject.getClass().isArray())
      throw new IllegalArgumentException("Source is not an array: " + paramObject);
    int i = Array.getLength(paramObject);
    if (i == 0)
      return new Object[0];
    Object[] arrayOfObject = (Object[])Array.newInstance(Array.get(paramObject, 0).getClass(), i);
    for (int j = 0; ; j++)
    {
      if (j >= i)
        return arrayOfObject;
      arrayOfObject[j] = Array.get(paramObject, j);
    }
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     org.springframework.util.ObjectUtils
 * JD-Core Version:    0.6.2
 */